Optimal. Leaf size=147 \[ -\frac{b \sec (e+f x)}{a^2 f \left (a+b \sec ^2(e+f x)-b\right )}-\frac{(a-4 b) \tanh ^{-1}(\cos (e+f x))}{2 a^3 f}-\frac{\sqrt{b} (3 a-4 b) \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{2 a^3 f \sqrt{a-b}}-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a+b \sec ^2(e+f x)-b\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.181454, antiderivative size = 147, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.261, Rules used = {3664, 471, 527, 522, 207, 205} \[ -\frac{b \sec (e+f x)}{a^2 f \left (a+b \sec ^2(e+f x)-b\right )}-\frac{(a-4 b) \tanh ^{-1}(\cos (e+f x))}{2 a^3 f}-\frac{\sqrt{b} (3 a-4 b) \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{2 a^3 f \sqrt{a-b}}-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a+b \sec ^2(e+f x)-b\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3664
Rule 471
Rule 527
Rule 522
Rule 207
Rule 205
Rubi steps
\begin{align*} \int \frac{\csc ^3(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2}{\left (-1+x^2\right )^2 \left (a-b+b x^2\right )^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}+\frac{\operatorname{Subst}\left (\int \frac{a-b-3 b x^2}{\left (-1+x^2\right ) \left (a-b+b x^2\right )^2} \, dx,x,\sec (e+f x)\right )}{2 a f}\\ &=-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}-\frac{b \sec (e+f x)}{a^2 f \left (a-b+b \sec ^2(e+f x)\right )}+\frac{\operatorname{Subst}\left (\int \frac{2 (a-2 b) (a-b)-4 (a-b) b x^2}{\left (-1+x^2\right ) \left (a-b+b x^2\right )} \, dx,x,\sec (e+f x)\right )}{4 a^2 (a-b) f}\\ &=-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}-\frac{b \sec (e+f x)}{a^2 f \left (a-b+b \sec ^2(e+f x)\right )}+\frac{(a-4 b) \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{2 a^3 f}-\frac{((3 a-4 b) b) \operatorname{Subst}\left (\int \frac{1}{a-b+b x^2} \, dx,x,\sec (e+f x)\right )}{2 a^3 f}\\ &=-\frac{(3 a-4 b) \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{2 a^3 \sqrt{a-b} f}-\frac{(a-4 b) \tanh ^{-1}(\cos (e+f x))}{2 a^3 f}-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}-\frac{b \sec (e+f x)}{a^2 f \left (a-b+b \sec ^2(e+f x)\right )}\\ \end{align*}
Mathematica [A] time = 6.18172, size = 218, normalized size = 1.48 \[ \frac{-\frac{8 a b \cos (e+f x)}{(a-b) \cos (2 (e+f x))+a+b}+\frac{4 \sqrt{b} (3 a-4 b) \tan ^{-1}\left (\frac{\sqrt{a-b}-\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )}{\sqrt{a-b}}+\frac{4 \sqrt{b} (3 a-4 b) \tan ^{-1}\left (\frac{\sqrt{a-b}+\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )}{\sqrt{a-b}}+4 (a-4 b) \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )-4 (a-4 b) \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )-a \csc ^2\left (\frac{1}{2} (e+f x)\right )+a \sec ^2\left (\frac{1}{2} (e+f x)\right )}{8 a^3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.101, size = 229, normalized size = 1.6 \begin{align*}{\frac{1}{4\,f{a}^{2} \left ( \cos \left ( fx+e \right ) +1 \right ) }}-{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) }{4\,f{a}^{2}}}+{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) b}{f{a}^{3}}}-{\frac{b\cos \left ( fx+e \right ) }{2\,f{a}^{2} \left ( a \left ( \cos \left ( fx+e \right ) \right ) ^{2}- \left ( \cos \left ( fx+e \right ) \right ) ^{2}b+b \right ) }}+{\frac{3\,b}{2\,f{a}^{2}}\arctan \left ({ \left ( a-b \right ) \cos \left ( fx+e \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}} \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}}-2\,{\frac{{b}^{2}}{f{a}^{3}\sqrt{b \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \cos \left ( fx+e \right ) }{\sqrt{b \left ( a-b \right ) }}} \right ) }+{\frac{1}{4\,f{a}^{2} \left ( \cos \left ( fx+e \right ) -1 \right ) }}+{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) }{4\,f{a}^{2}}}-{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) b}{f{a}^{3}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.52578, size = 1565, normalized size = 10.65 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.42445, size = 559, normalized size = 3.8 \begin{align*} \frac{\frac{6 \,{\left (a - 4 \, b\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}{a^{3}} - \frac{12 \,{\left (3 \, a b - 4 \, b^{2}\right )} \arctan \left (-\frac{a \cos \left (f x + e\right ) - b \cos \left (f x + e\right ) - b}{\sqrt{a b - b^{2}} \cos \left (f x + e\right ) + \sqrt{a b - b^{2}}}\right )}{\sqrt{a b - b^{2}} a^{3}} - \frac{3 \,{\left (\cos \left (f x + e\right ) - 1\right )}}{a^{2}{\left (\cos \left (f x + e\right ) + 1\right )}} + \frac{3 \, a^{2} + \frac{4 \, a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{28 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{16 \, b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac{2 \, a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac{8 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}{a^{3}{\left (\frac{a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}}{24 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]